package Text.Text002;

public class Pet {
    public String name;

    //    宠物共有动作
    public void eat() {
        System.out.println("吃东西");
    }

    public void sleep() {
        System.out.println("睡大觉");
    }

//    构造方法、set、get

    public Pet(String name) {
        this.name = name;
    }

    public Pet() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}